// 人事管理路由配置
const hrRoutes = {
  path: '/hr',
  component: () => import('@/layout'),
  redirect: '/hr/employee',
  name: 'HR',
  meta: {
    title: '人事管理',
    icon: 'user',
    roles: ['admin', 'hr']
  },
  children: [
    // 员工管理
    {
      path: 'employee',
      name: 'Employee',
      component: () => import('@/views/hr/employee/index'),
      meta: {
        title: '员工管理',
        icon: 'user',
        roles: ['admin', 'hr']
      }
    },
    {
      path: 'employee/detail/:id',
      name: 'EmployeeDetail',
      component: () => import('@/views/hr/employee/detail'),
      meta: {
        title: '员工详情',
        activeMenu: '/hr/employee',
        hidden: true
      }
    },
    {
      path: 'employee/create',
      name: 'EmployeeCreate',
      component: () => import('@/views/hr/employee/create'),
      meta: {
        title: '新增员工',
        activeMenu: '/hr/employee',
        hidden: true
      }
    },
    {
      path: 'employee/edit/:id',
      name: 'EmployeeEdit',
      component: () => import('@/views/hr/employee/edit'),
      meta: {
        title: '编辑员工',
        activeMenu: '/hr/employee',
        hidden: true
      }
    },
    // 合同管理
    {
      path: 'contract',
      name: 'Contract',
      component: () => import('@/views/hr/contract/index'),
      meta: {
        title: '合同管理',
        icon: 'document',
        roles: ['admin', 'hr']
      }
    },
    {
      path: 'contract/detail/:id',
      name: 'ContractDetail',
      component: () => import('@/views/hr/contract/detail'),
      meta: {
        title: '合同详情',
        activeMenu: '/hr/contract',
        hidden: true
      }
    },
    // 考勤管理
    {
      path: 'attendance',
      name: 'Attendance',
      component: () => import('@/views/hr/attendance/index'),
      meta: {
        title: '考勤管理',
        icon: 'calendar',
        roles: ['admin', 'hr']
      }
    },
    {
      path: 'attendance/stats',
      name: 'AttendanceStats',
      component: () => import('@/views/hr/attendance/stats'),
      meta: {
        title: '考勤统计',
        icon: 'chart',
        roles: ['admin', 'hr']
      }
    },
    // 招聘管理
    {
      path: 'recruitment',
      name: 'Recruitment',
      component: { render: h => h('router-view') },
      redirect: '/hr/recruitment/position',
      meta: {
        title: '招聘管理',
        icon: 'search',
        roles: ['admin', 'hr']
      },
      children: [
        {
          path: 'position',
          name: 'Position',
          component: () => import('@/views/hr/recruitment/position/index'),
          meta: {
            title: '职位管理',
            roles: ['admin', 'hr']
          }
        },
        {
          path: 'position/detail/:id',
          name: 'PositionDetail',
          component: () => import('@/views/hr/recruitment/position/detail'),
          meta: {
            title: '职位详情',
            activeMenu: '/hr/recruitment/position',
            hidden: true
          }
        },
        {
          path: 'resume',
          name: 'Resume',
          component: () => import('@/views/hr/recruitment/resume/index'),
          meta: {
            title: '简历管理',
            roles: ['admin', 'hr']
          }
        },
        {
          path: 'resume/detail/:id',
          name: 'ResumeDetail',
          component: () => import('@/views/hr/recruitment/resume/detail'),
          meta: {
            title: '简历详情',
            activeMenu: '/hr/recruitment/resume',
            hidden: true
          }
        }
      ]
    },
    // 培训管理
    {
      path: 'training',
      name: 'Training',
      component: { render: h => h('router-view') },
      redirect: '/hr/training/plan',
      meta: {
        title: '培训管理',
        icon: 'education',
        roles: ['admin', 'hr']
      },
      children: [
        {
          path: 'plan',
          name: 'TrainingPlan',
          component: () => import('@/views/hr/training/plan/index'),
          meta: {
            title: '培训计划',
            roles: ['admin', 'hr']
          }
        },
        {
          path: 'plan/detail/:id',
          name: 'TrainingPlanDetail',
          component: () => import('@/views/hr/training/plan/detail'),
          meta: {
            title: '计划详情',
            activeMenu: '/hr/training/plan',
            hidden: true
          }
        },
        {
          path: 'course',
          name: 'TrainingCourse',
          component: () => import('@/views/hr/training/course/index'),
          meta: {
            title: '培训课程',
            roles: ['admin', 'hr']
          }
        },
        {
          path: 'course/detail/:id',
          name: 'TrainingCourseDetail',
          component: () => import('@/views/hr/training/course/detail'),
          meta: {
            title: '课程详情',
            activeMenu: '/hr/training/course',
            hidden: true
          }
        }
      ]
    }
  ]
}

export default hrRoutes 